<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
	<title></title>
</head>
<body>
	<textarea type="text" rows="6" cols="50" id="text" style="max-width:100%;" onblur="create()">49AQC/BAAAAAAAAAAAAAAJAxhyhwdB5hO2O1VB++SOR4RYlS81U9ZNDa/JoTDT3ROKYG1U9AC0BUEDISERFZq72tt1FITeOnUItz9Uagbzl/Vmi0ocULleTcKR7desT9vBaTTsDOFq5cZYSPUjnUh4DTcS0ZbkKxQhpLiuK6RgbAN0FcmJKp8x9FTO5Zsr8ynzEggVtHHdSQPAJd5/BcjaiKUepV1hqM1VAaP9QyyaJ4MWkBivTxLpBU/6OrtVVvKFs1U=</textarea>
	<div>
	<select id="level" onchange="create()">
	  <option value ="L">L</option>
	  <option value ="M">M</option>
	  <option value="Q">Q</option>
	  <option value="H">H</option>
	</select>
	<select id="size" onchange="create()">
	  <option value ="150">150</option>
	  <option value ="200">200</option>
	   <option value ="250">250</option>
	  <option value="300">300</option>
	  <option value="400">400</option>
	</select>
	<span><span id="count">0</span>个字符</span>
	<input type="button" value="单离线码" onclick="onesign()"/>
	</div>
	<div style="text-align:center;margin:auto;width:150px;" id="qrcode2"></div>
	</div>
	<script src='qrcode.js'></script>
	
	<script>
		function onesign(){
			document.getElementById("text").value="49AgBZBAcAAAAAAAAAAAAJALQFQQMhIRFgbpo7FTbjSN6waTXy0TO+iy+yYeNnSNL6x6RVDj+XlgCcYb6QH85YHZIkqDAwBZyJ9LCT+MAC/pFlqz/MaPTio8YKh5s=";
			create();
		}
		function create(){
			let text=document.getElementById("text").value;
			document.getElementById("count").textContent=text.length;
			let level=document.getElementById("level").value;
			let correctLevel=QRCode.CorrectLevel.L;
			let size=document.getElementById("size").value;
			document.getElementById("qrcode2").style.width=parseInt(size)+"px";
			document.getElementById("qrcode2").style.height=parseInt(size)+"px";
			if(level=='M'){correctLevel=QRCode.CorrectLevel.M;}
			if(level=='Q'){correctLevel=QRCode.CorrectLevel.Q;}
			if(level=='H'){correctLevel=QRCode.CorrectLevel.H;}
			document.getElementById("qrcode2").innerHTML='';
			qrcode=new QRCode(document.getElementById("qrcode2"),{
				text:text,
				width:parseInt(size),
				height:parseInt(size),
				correctLevel:correctLevel}
			);
		}
		create();
	</script>
</body>
</html>